package com.woniu.outlet.dao;

import com.woniu.outlet.po.UserPo;
import com.woniu.outlet.po.Worker;
import com.woniu.outlet.po.WorkerExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

public interface WorkerMapper {
    long countByExample(WorkerExample example);

    int deleteByExample(WorkerExample example);

    int deleteByPrimaryKey(Long id);

    int insert(Worker record);

    int insertSelective(Worker record);

    List<Worker> selectByExample(WorkerExample example);

    Worker selectByPrimaryKey(Long id);

    int updateByExampleSelective(@Param("record") Worker record, @Param("example") WorkerExample example);

    int updateByExample(@Param("record") Worker record, @Param("example") WorkerExample example);

    int updateByPrimaryKeySelective(Worker record);

    int updateByPrimaryKey(Worker record);

    @Select("select p.percode " +
            "from rbac_perms p inner join rbac_user_perm up on p.id=up.permid " +
            "inner join erp_system_management.ERP_worker u on u.id=up.userid " +
            "where u.account=#{username}")
    List<String> getPercodeByUsername(String username);
}